/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for 
 * full list of contributors). Published under the 2-clause BSD license.
 * See license.txt in the OpenLayers distribution or repository for the
 * full text of the license. */

/**
 * requires OpenLayers/Popup/Framed.js
 * requires OpenLayers/Popup/FramedCloud.js
 * requires OpenLayers/Util.js
 * requires OpenLayers/BaseTypes/Bounds.js
 * requires OpenLayers/BaseTypes/Pixel.js
 * requires OpenLayers/BaseTypes/Size.js
 */

/**
 * Class: OpenLayers.Popup.FramedCloudVolunteer
 * 
 * Inherits from: 
 *  - <OpenLayers.Popup.FramedCloud>
 */
OpenLayers.Popup.FramedCloudVolunteer = 
  OpenLayers.Class(OpenLayers.Popup.FramedCloud, {

    imageSize: new OpenLayers.Size(12, 12),

    maxSize: new OpenLayers.Size(200, 200),

    fixedRelativePosition: true,

    relativePosition: 'tr',

    positionBlocks: {
        'tr': {
            'offset': new OpenLayers.Pixel(-80, 0),
            'padding': new OpenLayers.Bounds(0, 25, 0, 0), // left, bottom, right, top. Don't use Negative.
            'blocks': [
                { // stem
                    size: new OpenLayers.Size(12, 12),
                    anchor: new OpenLayers.Bounds(80, 30, null, null),
                    position: new OpenLayers.Pixel(0, 0) // within image
                }
            ]
        }
    },

    initialize: function(id, lonlat, contentSize, contentHTML, anchor, closeBox, closeBoxCallback) {
        this.imageSrc = S3.Ap.concat('/static/themes/Vulnerability/img/mapPopupStemVolunteer.png');
        OpenLayers.Popup.Framed.prototype.initialize.apply(this, arguments);
        this.contentDiv.className = this.contentDisplayClass;
    },

    addCloseBox: function(callback) {
        OpenLayers.Popup.Framed.prototype.addCloseBox.apply(this, arguments);
        this.closeDiv.className = "olVolPopupCloseBox";
    },

    CLASS_NAME: 'OpenLayers.Popup.FramedCloudVolunteer'
});
